﻿//===COMMENT===package bubble3d.animation {	import bubble3d.core3d.Object3D;	import bubble3d.main.World3D;	import bubble3d.math.Calculations;	import bubble3d.model.Vertex;	import bubble3d.physics.Physics3D;	import bubble3d.rendering.Engine;	import bubbletools.util.Pointdata;
	public class Explode extends Animation {		private var initScale:Number = .2;		private var decay:Number = .999;		public function Explode(object3D:Object3D) {			initAnimation(object3D);			totalFrames = 50;			var objects3D:Array = object3D.getObjects();			for (var k:Number = 0; k < objects3D.length; k++) {				var origin:Vertex = objects3D[k].getOrigin();				var center:Vertex = objects3D[k].getCenter();				var deltaVector:Vertex = Calculations.getVectorDelta(center, origin);				var explodeVector:Vertex = Calculations.getVectorScale(deltaVector, initScale);				trace(explodeVector);				if (objects3D[k].getPhysics() == null) {					Physics3D.addObjectPhysics(objects3D[k]);				}				objects3D[k].getPhysics().addMotionVector(explodeVector);				objects3D[k].getPhysics().startGravity();			}		}		public override function animate():void {			currentFrame++;			if (currentFrame >= totalFrames) {				completeAnimation();			}		}	}}